"use strict";
const BaseImpl = require("../basics/clz/baseimpl");
const MasterModel = require("../model/master");

/**
 * 通用服务
 */
class HomeImpl extends BaseImpl {

  /**
   * 查询sellerId
   */
  async findSellerId(appId) {
    if (!appId) {
      return "";
    }
    let master = await MasterModel.getInstant(this.cloud).selectOneByAppId(appId);
    if (!master) {
      master = await MasterModel.getInstant(this.cloud).selectOneByDef();
    }
    if (!master) {
      return "";
    }
    return master.sellerId;
  }
}

module.exports = HomeImpl;